<template>
    <input type="file" :value="fileName" v-show="false" ref="inputRef" @change="fileChange">
    <el-button type="primary" @click="inputRef.click()">
      请上传<el-icon class="el-icon--right"><Upload /></el-icon>
    </el-button>
    <span style="text-indent: 10px;">{{ fileObject.fileName }}</span>
  </template>
  
  <script setup lang="ts">
import { reactive, ref } from 'vue';

const fileName=ref('')
const inputRef=ref()
let fileObject=reactive({
    fileName:''
})
const fileChange=(e)=>{
    let file=e.target.files[0]
    fileObject.fileName=''
    fileObject.fileName=file.name
    console.log(fileObject.fileName)
}
  </script>
  
  <style scoped lang="scss">
  </style>